<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main"/>
  <title>Future Events</title>
</head>
<body>
<div class="body">
  <h1>Future Events</h1>
  <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
  </g:if>
  <div class="list">
    <table>
      <thead>
      <tr>
        <g:sortableColumn property="name" title="Name"/>
        <g:sortableColumn property="description" title="Description"/>
        <g:sortableColumn property="startDate" title="Start Date"/>
        <g:sortableColumn property="endDate" title="End Date"/>
        <g:sortableColumn property="owner" title="Owner"/>
        <th></th>
      </tr>
      </thead>
      <tbody>
      <g:each in="${eventInstanceList}" status="i" var="eventInstance">
        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
          <td>${fieldValue(bean: eventInstance, field: 'name')}</td>
          <td>${fieldValue(bean: eventInstance, field: 'description')}</td>
          <td>${fieldValue(bean: eventInstance, field: 'startDate')}</td>
          <td>${fieldValue(bean: eventInstance, field: 'endDate')}</td>
          <td>${fieldValue(bean: eventInstance, field: 'owner')}</td>
          <td>
            <g:link action="show" id="${eventInstance.id}">Event Details</g:link>
          </td>
        </tr>
      </g:each>
      </tbody>
    </table>
  </div>
  <div class="paginateButtons">
    <g:paginate total="${eventInstanceTotal}"/>
  </div>
</div>
</body>
</html>
